package com.dtease.agent.biz.ai.controller;


import com.dtease.agent.biz.ai.service.IBasLlmConfigService;
import com.dtease.agent.biz.ai.vo.BasLlmConfigVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 存储大模型配置信息，记录可用的大模型名称及基础元数据 前端控制器
 * </p>
 *
 * @author chentl
 * @since 2025-05-12
 */
@Validated
@RestController
@RequestMapping("/llm")
public class BasLlmConfigController {
    @Resource
    private IBasLlmConfigService llmConfigService;

    @GetMapping("/list")
    public Mono<List<BasLlmConfigVO>> getLlmList() {
        // 调用服务层方法获取大模型列表
        Mono<List<BasLlmConfigVO>> llmListMono = Mono.fromCallable(() -> llmConfigService.getValidLlmList());
        return llmListMono;
    }
}

